﻿using System;
using System.Collections.Generic;

namespace 集合2
{
    class Program
    {
     //1.定义两个存放(int)的集合，集合listA {“a”,”b”,”c”,”d”,”e”}
     //listB {“d”,”e”,”f”,”g”,”h”},
     //将这两个集合去除重复项后合并成一个集合。 Contains


        static void Main(string[] args)
        {
            
            List<string> listA = new List<string> ();
            listA.AddRange(new string[] { "a","b","c","d","e" });

            List<string> listB = new List<string>();
            listB.AddRange(new string[] { "d","e","f","g","h" });

            for (int i = 0; i < listB.Count; i++)
            {
                if (!listA.Contains(listB[i]))
                {
                    listA.Add(listB[i]);
                }
            
            
            }
            Console.WriteLine(string.Join(" ",listA));
            


        }
    }
}
